package com.gidas.server;

import java.util.List;

import javax.jdo.PersistenceManager;

import com.gidas.server.PMF;

public class StopManipulations {

    @SuppressWarnings("finally")
	public static boolean destroyAllStops()
    {
    	PersistenceManager pm = PMF.get().getPersistenceManager();
        String query = "select from " + StopDB.class.getName();
        List<StopDB> stopsList = (List<StopDB>) pm.newQuery(query).execute();
        if (!stopsList.isEmpty()) 
        {
        	try
        	{
        		pm.deletePersistentAll(stopsList);
        	}
        	finally
        	{
        		pm.close();	
        		return true;
        		
        	}
       	
        }    
		return false;
    }
	
}
